<%@ page language="java" pageEncoding="UTF-8"%>
<%@include file="/pc/jsp/common/common.jsp"%>
<%@ page language="java" import="com.limao.DBDataClass.CrowdVRHomeClass"%>
<%@ page language="java" import="com.limao.DBDataClass.CrowdUserAuthClass"%>

<%
 String userid=(String)CacheClass.isLogin(request,response);
 if(CacheClass.getIntValue(userid)==0)
 {
 	out.println("<script language='JavaScript'>alert('您还没有登陆！');location.href='';</script>"); //后退并刷新
 	return;
 } 
  CrowdUserAuthClass user= WebFunction.getUserInfo(request,response);
 if(user==null)
 {
	 out.println("<script language='JavaScript'>alert('用户不存在，或被平台禁用，请联系客服！');window.history.back(-1);</script>");
	 return;
 } 
 
CrowdVRHomeClass obj= WebFunction.getVrHomeInfo(request,response);
 if(obj==null)
 {
	 out.println("<script language='JavaScript'>alert('交易公司不存在，或平台已中止与供公司合作，暂不开放提单交易服务！');window.history.back(-1);</script>");
	 return;
 }
 %>
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
    <title>资金转入期指投资</title>
    <style>
        body{
            width: 736px;
            height: 100%;
            background: #fff;
        }
    </style>
</head>
<body ontouchstart="">
<div class="c3 f25 tc jz pr zijinTop">
    资金转入提单交易 <span class="db pa c3 cursor fw700 closeBtn" id="close-x">&times;</span>
</div>
<div class="zijinBlock jz">
    <div class="clearfix of" style="line-height: 34px;margin-top: 38px;">
        <p class="fl f19 c9" style="width: 233px;">您的可用金额</p>  <p class="fl corange f28"><span style="font-size: 34px;"><%=user.nowrmb  %></span></p>
    </div>
    <div class="clearfix of" style="line-height: 34px;margin-top: 20px;margin-bottom: 15px;">
        <p class="fl f19 c9" style="width: 233px;">期指投资可用金额</p>  <p class="fl corange f28"><span style="font-size: 34px;">20,000.</span>0</p>
    </div>
    <input type="number" name="" id="money" min="0" placeholder="转入金额" class="zijinInput db f20 br6"/>
    <p class="cred f14 t2 lh15"></p>
    <input type="text" name="" id="loginPwd" placeholder="您的登陆密码" class="zijinInput db f20 br6"/>
    <p class="cred f14 t2 lh15"></p>
    <div class="clearfix of" style="line-height: 34px;margin-top: 38px;">
        <p class="fl f19 c9" style="width: 233px;">同时可获赠券额</p>
        <p class="fl corange f28"><span style="font-size: 34px;">500,000.</span>00</p>
        <a href="commonProblems.html" class="fl db aht cgreen f15 mgl16">赠券适用说明</a>
    </div>
    <div class="clearfix of" style="line-height: 34px;margin-top: 20px;margin-bottom: 15px;">
        <p class="fl f19 c9" style="width: 233px;">期指投资可用金额将为</p>
        <p class="fl corange f28"><span style="font-size: 34px;">800,000.</span>00</p>
    </div>
    <input type="button" name="" value="确认转入" id="" onclick="Sub();" class="db jz bcblue cf f27 tc cursor" style="width: 403px;height: 63px;line-height: 63px;margin-top: 68px;"/>
</div>


<div id="loadingfDiv" class="loadingfDiv pf w100 h100 db">
    <div class="w100 h100">
        <img src="pc/images/loading.gif" class="db jz" style="margin-top: 40%;">
    </div>
</div><!--loadinfDiv-->


<script>

    $(window).on("load", function() {
        $("#zijinZhuanru", parent.document).click(function () {
            $("#zijinIframeDiv", parent.document).slideDown();
            $(".theme-popover-mask", parent.document).fadeIn();

        })
        $("#close-x").click(function () {
            $("#zijinIframeDiv", parent.document).slideUp();
            $(".theme-popover-mask", parent.document).fadeOut();

        })
    })

    function Sub() {
        var money =$.trim($('#money').val());
        var loginPwd = $.trim($('#loginPwd').val());
        if(money== ""){
            $('#money').next('p').text('你还未填写金额');
            return false;
        }else {
            $('#money').next('p').text(' ');
        }
        if(loginPwd== ""){
            $('#loginPwd').next('p').text('你还未填写密码');
            return false;
        }else {
            $('#loginPwd').next('p').text(' ');
        }
        $.ajax({
            url: "",
            data: {money: money, loginPwd: loginPwd},
            type: 'post',
            dataType: 'json',
            beforeSend: function () {
                $("#loadingfDiv").fadeIn();
            },
            success: function (data) {
                console.log(data);
                if (data.code == 200) {
//                        alert("您的申请已提交,等待审核");
//                        alert(data.msg);
//                        window.location.reload();
//                        location.href = "withdraw.html";
                }else{
//                        alert(data.msg);
                    //window.history.back(-1);
                }
            },
            error: function (data) {
                alert(data.msg);
                return false;
            },
            complete: function () {
                $("#loadingfDiv").fadeOut();
                $("#close-x").trigger('click');
            }
        });
    }
</script>
</body>
</html>